<%@ Page EnableEventValidation="False" Title="Search for Component" Language="C#" MasterPageFile="~/Pages/user/userMaster.Master" AutoEventWireup="true" CodeBehind="SearchComponent.aspx.cs" Inherits="WarehouseWebAPP.Pages.user.WebForm7" %>
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="cc1" %>
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit.HTMLEditor" tagprefix="cc2" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <style type="text/css">
        .style23
        {
            width: 116px;
        }
        .style24
        {
            width: 99px;
        }
        .style25
        {
            width: 203px;
        }
        .style26
        {
            width: 269px;
        }
        .style27
        {
            position: relative;
        }
    </style>
    </asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <table class="style27">
         <tr>
             <td class="style23" valign="top">
    <asp:Label ID="Label6" runat="server" Text="Serial"></asp:Label>
             </td>
             <td class="style25" valign="top">
                 <cc1:ComboBox ID="ComboBox1" runat="server" AppendDataBoundItems="True" 
                     AutoCompleteMode="Append" DataSourceID="ComponentObjectDataSource" 
                     DataTextField="component_serial_num" DataValueField="component_serial_num" 
                     MaxLength="0" ondatabound="ComboBox1_DataBound">
                 </cc1:ComboBox>
             </td>
             <td class="style24" valign="top">
    <asp:Label ID="Label4" runat="server" Text="Less Than"></asp:Label>
             </td>
             <td valign="top" class="style26">
    <asp:TextBox ID="QuantityTextBox" runat="server"></asp:TextBox>
             </td>
         </tr>
         <tr>
             <td class="style23" valign="top">
    <asp:Label ID="Label2" runat="server" Text="Description"></asp:Label>
             </td>
             <td class="style25" valign="top">
    <asp:TextBox ID="DescriptionTextBox" runat="server"></asp:TextBox>
             </td>
             <td class="style24" valign="top">
    <asp:Label ID="Label7" runat="server" Text="Vendor"></asp:Label>
             </td>
             <td valign="top" class="style26">
                 <cc1:ComboBox ID="VendorComboBox" runat="server" AppendDataBoundItems="True" 
                     AutoCompleteMode="Append" DataSourceID="VendorObjectDataSource" 
                     DataTextField="vendor_name" DataValueField="vendor_num" 
                     DropDownStyle="DropDownList" MaxLength="0" 
                     ondatabound="VendorComboBox_DataBound">
                 </cc1:ComboBox>
             </td>
         </tr>
         <tr>
             <td class="style23" valign="top" >
    <asp:Label ID="Label3" runat="server" Text="Place"></asp:Label>
             </td>
             <td class="style25" valign="top">
    <asp:TextBox ID="PlaceTextBox" runat="server"></asp:TextBox>
             </td>
             <td class="style24" valign="top">
    <asp:Label ID="Label8" runat="server" Text="Supplier"></asp:Label>
             </td>
             <td valign="top" class="style26">
                 <cc1:ComboBox ID="SupplierComboBox" runat="server" AppendDataBoundItems="True" 
                     AutoCompleteMode="Append" DataSourceID="SupplierObjectDataSource" 
                     DataTextField="supplier_name" DataValueField="supplier_num" 
                     DropDownStyle="DropDownList" MaxLength="0" 
                     ondatabound="SupplierComboBox_DataBound">
                 </cc1:ComboBox>
             </td>
         </tr>
         <tr>
             <td align="right" bgcolor="#E3E6EA" colspan="3" valign="top">
                 &nbsp;</td>
             <td align="left" bgcolor="#E3E6EA" valign="top" class="style26">
            <asp:Button ID="Button1" runat="server" BackColor="#FFFBFF" 
 BorderColor="#CCCCCC" BorderStyle="Solid" BorderWidth="1px"  
 Font-Names="Verdana" Font-Size="Small" ForeColor="#284775" Text="Search" Width="76px" 
                     onclick="Button1_Click1"/>
             </td>
         </tr>
         <tr>
             <td colspan="4">
    
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <asp:GridView ID="ComponentGridView" runat="server" Width="630px" AllowPaging="True" 
        AutoGenerateColumns="False" DataKeyNames="component_num" 
        DataSourceID="ObjectDataSource" CellPadding="4" ForeColor="#333333" 
        GridLines="None" AllowSorting="True" 
        ondatabound="ComponentGridView_DataBound" 
        onrowcommand="ComponentGridView_RowCommand">
                <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
                <Columns>
                    <asp:BoundField DataField="component_num" 
                HeaderText="component_num" SortExpression="component_num" ReadOnly="True" 
                Visible="False" />
                    <asp:BoundField DataField="component_serial_num" 
                HeaderText="Serial No." SortExpression="component_serial_num" />
                    <asp:BoundField DataField="component_description" HeaderText="Description" 
                SortExpression="component_description" />
                    <asp:BoundField DataField="component_place" HeaderText="Place" 
                SortExpression="component_place" />
                    <asp:BoundField DataField="component_quantity" HeaderText="Quantity" 
                SortExpression="component_quantity" />
                    <asp:TemplateField HeaderText="Vendor" SortExpression="component_vendor">
                        <EditItemTemplate>
                            <asp:TextBox ID="TextBox1" runat="server" 
                        Text='<%# Bind("component_vendor") %>'></asp:TextBox>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="VendorLabel" runat="server" 
                        Text='<%# Bind("component_vendor") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Supplier" SortExpression="component_supplier">
                        <EditItemTemplate>
                            <asp:TextBox ID="TextBox2" runat="server" 
                        Text='<%# Bind("component_supplier") %>'></asp:TextBox>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="SupplierLabel" runat="server" 
                        Text='<%# Bind("component_supplier") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
                <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" 
                    HorizontalAlign="Left" />
                <EditRowStyle BackColor="#999999" />
                <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
            </asp:GridView>
        </ContentTemplate>
        <Triggers>
            <asp:AsyncPostBackTrigger ControlID="Button1" EventName="Click" />
        </Triggers>
    </asp:UpdatePanel>
    
             </td>
         </tr>
    </table>
    
    <asp:LinkButton ID="LinkButton1" runat="server" onclick="LinkButton1_Click">Export 
    to Excel</asp:LinkButton>
    
    <asp:ObjectDataSource ID="SupplierObjectDataSource" runat="server" 
        SelectMethod="SupplierGet" TypeName="WarehouseWebAPP.code.BLL.SupplierBLL">
    </asp:ObjectDataSource>
    <asp:ObjectDataSource ID="VendorObjectDataSource" runat="server" 
        SelectMethod="VendorGet" TypeName="WarehouseWebAPP.code.BLL.VendorBLL">
    </asp:ObjectDataSource>
    
    <asp:ObjectDataSource ID="ComponentObjectDataSource" runat="server" 
        SelectMethod="ComponentGetData" 
        TypeName="WarehouseWebAPP.code.BLL.ComponentBLL"></asp:ObjectDataSource>
    
    <asp:ObjectDataSource ID="ObjectDataSource" runat="server" 
        SelectMethod="ComponentSearch" 
        TypeName="WarehouseWebAPP.code.BLL.ComponentBLL" 
        OldValuesParameterFormatString="original_{0}">
        <SelectParameters>
            <asp:ControlParameter ControlID="ComboBox1" DefaultValue="%" 
                Name="component_serial_num" PropertyName="SelectedValue" Type="String" />
            <asp:ControlParameter ControlID="VendorComboBox" DefaultValue="" 
                Name="component_vendor" PropertyName="SelectedValue" Type="String" />
            <asp:ControlParameter ControlID="DescriptionTextBox" 
                Name="component_description" PropertyName="Text" Type="String" 
                DefaultValue="%" />
            <asp:ControlParameter ControlID="PlaceTextBox" DefaultValue="%" 
                Name="component_place" PropertyName="Text" Type="String" />
            <asp:ControlParameter ControlID="QuantityTextBox" DefaultValue="32000" 
                Name="component_quantity" PropertyName="Text" Type="Int32" />
            <asp:ControlParameter ControlID="SupplierComboBox" DefaultValue="" 
                Name="component_supplier" PropertyName="SelectedValue" Type="String" />
        </SelectParameters>
    </asp:ObjectDataSource>
    
    <br />
    
</asp:Content>
